/*
* common.h - This file is the part of the wp-notifier.(code name "luan luan")
* Copyright (C) 2010 Dean Lee <deanlee3@gmail.com>, http://www.deanlee.cn
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
* 
* Acknowledgements:
*   <> Many thanks to all of you, who have encouraged me to update my articles
*     and code, and who sent in bug reports and fixes.
* 
*/
#ifndef COMMON_H
#define COMMON_H
#define PROG_VERSION "0.11"
#include <QString>
#include <QDomElement>
class QWidget;
class QDateTime;
void setStartup(bool startup);
QString homeDir();
void bringToFront(QWidget *widget);
QString dateDiffString(const QDateTime& d);
QString escapedString(const QString &s, bool escapeWhitespace = true);

QDomElement findSubTag(const QDomElement &e, const QString &name, bool *found);
QString tagContent(const QDomElement &e);
void readEntry(const QDomElement &e, const QString &name, QString *v);
void readNumEntry(const QDomElement &e, const QString &name, int *v);
void readBoolEntry(const QDomElement &e, const QString &name, bool *v);
void readSizeEntry(const QDomElement &e, const QString &name, QSize *v);
void readRectEntry(const QDomElement &e, const QString &name, QRect *v);
QDomElement textTag(QDomDocument &doc, const QString &name, QSize &s);
QDomElement textTag(QDomDocument &doc, const QString &name, QRect &r);
QDomElement textTag(QDomDocument &doc, const QString &name, const QString &content);












#endif